
//缓冲运动
function doMove( obj, target ){		//缓冲运动的速度是一个不断改变的值，所以跟匀速运动相比，少设置了一个变量speed
	clearInterval( obj.timer );

	obj.timer = setInterval(function (){
		var speed = ( target - obj.offsetLeft )/12;
		speed = speed > 0 ? Math.ceil( speed ) : Math.floor( speed );

		var nextPos = obj.offsetLeft + speed;
		if ( nextPos > target && speed > 0 || nextPos < target && speed < 0 ) {
			nextPos == target;
		};

		obj.style.left = nextPos + 'px';		//这里千万不要写成obj.offsetLeft(以后要是改写的是宽度，这里也不能是offsetWidth)

		if ( nextPos == target ) {
			clearInterval( obj.timer );
		};
	},30)
}